const express = require('express')
const consul = require('./lib/consulUtil')
const health = require('./routers/health')
const hello = require('./routers/hello')
const app = express();

app.all('*', (req, res, next) => {
    console.log(`log----->time:${new Date().toISOString()},user ${req.ip},url:${req.url},method:${req.method}`)
    next();
})

app.get('/', (req, res) => res.send(`Hello World! my name is www`))
app.use(health);
app.use(hello);
consul.consulInit();

module.exports = app;
